
package com.zzg.common.base.exception;

/**
 * @ClassName: UnprocessableException
 * @Description: TODO(运行异常基类)
 * @author zzg
 * @date 2018年4月28日 上午9:50:56
 * 
 */
public class UnprocessableException extends RuntimeException implements Code {
	private static final long serialVersionUID = 7977671792981439759L;

	private Code code = null;

	public UnprocessableException(Code code, String message) {
		super(message);
		this.code = code;
	}

	public UnprocessableException(Code code) {
		super(String.valueOf(code.getCode()));
		this.code = code;
	}

	@Override
	public int getCode() {
		// TODO Auto-generated method stub
		return code.getCode();
	}

}
